package com.me.crgame.screens;


import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Screen;
import com.badlogic.gdx.graphics.GL20;
import com.me.crgame.CrazyRocketsGame;
import com.me.crgame.core.Director;
import com.me.crgame.core.EnumEscena;


public class ScreenMenu implements Screen{
	
	private Director director;
	//private Music musica;
	private CrazyRocketsGame game;
	
	public ScreenMenu(CrazyRocketsGame game){
		this.game = game;
	}
	
	@Override
	public void show() {
		director = Director.getInstance();
		director.setGame(game);
		director.inicializarTransiciones();
		
		//musica=Gdx.audio.newMusic(Gdx.files.internal("data/sistema_menus/musica_menu.mp3"));
		
		//musica.setLooping(true);
	    //musica.play();
		director.activarEscena(EnumEscena.PANTALLA_INICIO);
		
	
	}
	
	@Override
	public void render(float delta) {
		Gdx.graphics.getGL20().glClearColor( 0, 0, 0, 1 );
		Gdx.graphics.getGL20().glClear( GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT );
		director.render(delta);
	}

	@Override
	public void resize(int width, int height) {}

	@Override
	public void hide() {
		//director.dispose();
	}

	@Override
	public void pause() {
		director.pause();
	}

	@Override
	public void resume() {
		director.resume();
	}

	@Override
	public void dispose() {
		director.dispose();
		//musica.dispose();
	}

}
